<include file="Public/inc/lite_header.html" />
    <body class="hold-transition login-page">
        <div class="login-box">
            <div class="login-box-body">
                <p class="login-box-msg">重置密码</p>
                <form action="/drm/index.php/Home/User/Index/userRecover.html" method="post">
                    <div class="alert alert-danger checkPwd" style='display:none' role="alert"></div>
                    <div class="form-group has-feedback">
                        <input type="text" class="form-control" name='username' placeholder="请输入要修改密码的用户名" value="{$Think.cookie.username}" readonly="readonly" required>
                        <span class="glyphicon glyphicon-user form-control-feedback"></span>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" class="form-control" name='pwd' placeholder="请输入密码" required>
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>
                    <div class="form-group has-feedback">
                        <input type="password" class="form-control" name='rePwd' placeholder="确认密码" required>
                        <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                    </div>
                    <div class="row">
                        <div class="col-xs-4">
                            <button type="submit" class="btn btn-primary btn-block btn-flat">确认修改</button>
                        </div><!-- /.col -->
                    </div>
                </form>

                </br>
            <!--     <a href="/drm/index.php/Home/User/Index/userAdd.html" class="text-center">注册新用户</a>
                <span >　or　</span> -->
                <a href="/drm/" class="text-center">我要登录</a>
            </div><!-- /.login-box-body -->
        </div><!-- /.login-box -->
        <include file="Public/inc/lite_footer.html" />
        
            <script>
                $(function () {
                    $('input').iCheck({
                        checkboxClass: 'icheckbox_square-blue',
                        radioClass: 'iradio_square-blue',
                        increaseArea: '20%' // optional
                    });
                });

                $("input[name='username']").blur(function(){
                    var username = $(this).val();
                    $.post('/drm/index.php/Home/User/Index/userCheck.html',{'name':username},function(i){
                        if(i != 1){
                            $('.checkPwd').html('对不起没有这个用户');
                            $('.checkPwd').fadeIn(1000);
                            $("input[name='username']").val('');
                        }else{
                            $('.checkPwd').fadeOut(1000);
                        }
                    })
                })

                $("button[type='submit']").click(function(){
                    var pwd = $("input[name='pwd']").val();
                    var rePwd = $("input[name='rePwd']").val();
                    if(pwd != rePwd){
                        $('.checkPwd').html('两次密码要保持一致哦');
                        $('.checkPwd').fadeIn(1000);
                        return false;
                    } else {
                        $('.checkPwd').fadeOut(1000);
                    }
                })
            </script>
